﻿@{
    
}
@section head{
    <title>授权证书生成</title>
}
@section content{
    <div id="pageflag" data-nav="office" data-ban="Watermark"></div>
    <div class="container margin_t5">
        <ol class="breadcrumb">
            <li><a title="会员中心" href="/User/Default">会员中心</a></li>
            <li class="active">授权证书生成</li>
        </ol>
    </div>
    <div class="container u_cnt btn_green">
        <table class="table table-striped table-bordered table-hover">
            <tr>
                <td class="text-center" title="姓名">姓名：</td>
                <td><input type="text" class="form-control" data-state="edit" ID="Name" name="Name" value="@ViewBag.username" /></td>
                <td class="text-center" title="微信号码">微信号码：</td>
                <td><input type="text" class="form-control" data-state="edit" ID="VName" name="VName" value="queezn:197016" /></td>
                <td class="text-center" title="授权人">授权人：</td>
                <td><input type="text" class="form-control" data-state="edit" ID="GiveMan" name="GiveMan" value="@Call.SiteName" /></td>
            </tr>
            <tr>
                <td class="text-center" title="品牌">品牌：</td>
                <td><input type="text" data-state="edit" class="form-control" ID="CardName" name="CardName" value="奥华康,加纳" /></td>
                <td class="text-center" title="授权时间">授权时间：</td>
                <td><input type="text" class="form-control" data-state="edit" onclick="WdatePicker();" ID="StartDate" name="StartDate" value="@DateTime.Now.ToString("yyyy/MM/dd")" /></td>
                <td class="text-center" title="到期时间">到期时间： </td>
                <td><input type="text" class="form-control" data-state="edit" onclick="WdatePicker();" ID="EndDate" name="EndDate" value="@DateTime.Now.AddYears(1).ToString("yyyy/MM/dd")" /></td>
            </tr>
            <tr>
                <td class="text-center" title="标题">标题：</td>
                <td><input type="text" class="form-control" data-state="edit" ID="Title_T" name="Title_T" value="@(Call.SiteName)证书生成" /></td>
                <td class="text-center" title="授权编号">授权编号：</td>
                <td><input type="text" class="form-control" data-state="edit" ID="Auth_Code_T" name="Auth_Code_T" value="1401459842002690" /></td>
                <td class="text-center" title="授权企业">授权企业：</td>
                <td><input type="text" class="form-control" data-state="edit" ID="Auth_Name_T" name="Auth_Name_T" value="@Call.SiteName" /></td>
            </tr>
            <tr>
                <td colspan="6" class="text-center">
                    <input type="button" class="btn btn-primary" value="确定生成" onclick="EditImage()" />
                    <a href="javascript:ClearData()" class="btn btn-primary">重置参数</a>
                </td>
            </tr>
        </table>
    </div>
}
@section script{
    <script type="text/javascript" src="/JS/DatePicker/WdatePicker.js"></script>
    <script type="text/javascript">
        function EditImage() {
            if ($("#Name").val() != "" && $("#Auth_Code_T").val() != "") {
                var url = "HtmlToJpg?Name=" + $("#Name").val() + "&VName=" + $("#VName").val() + "&GiveMan=" + $("#GiveMan").val() + "&CardName=" + $("#CardName").val() + "&StartDate=" + $("#StartDate").val() + "&EndDate=" + $("#EndDate").val() + "&Title=" + $("#Title_T").val() + "&Auth_Code=" + $("#Auth_Code_T").val() + "&Auth_Name=" + $("#Auth_Name_T").val();
                window.open(url);
            } else {
                alert("证书名和授权编号不能为空！");
            }

        }
        function ClearData() {
            $("[data-state=edit]").val("");
        }
    </script>
}
